package starComponent.experiments.expeComparison;

import java.awt.Color;

import starComponent.E_PossibleBranches;
import starComponent.experiments.expedependencies.E_Experiment;
import starComponent.experiments.expedependencies.Validator;
import starComponent.parallelcoordinates.ParallelBranchBiSlider;
import starComponent.parallelcoordinates.ParallelBranchSlider;
import starComponent.parallelcoordinates.ParallelCoordinatesComponent;
import starComponent.parallelcoordinates.ParallelLadder;

public class TestParallelCoordinates extends A_Expe2Comparison{
	
	public TestParallelCoordinates(int groupNumber){
		super(groupNumber);
		
		this.thumbToObserve = "Gazol";
		
		initStartButton(E_Experiment.COMPARISON_SCENARIO1_PARALLEL, 50, Validator.VALIDATE_IF_LESS_THAN);
		listenThumbToObserve();
	}
	
	public static void main (String[]args){
		new TestParallelCoordinates(0);
	}


	@Override
	protected void buildBranchList(ParallelCoordinatesComponent parallelCoordinates){
		
		ParallelBranchSlider nbKm = new ParallelBranchSlider(
				parallelCoordinates,
				E_PossibleBranches.NB_KM,
				0,
				Color.RED,
				new ParallelLadder(E_PossibleBranches.NB_KM,
						true, 
						true,
						Color.RED, Color.RED
						)
				);

		ParallelBranchBiSlider cost = new ParallelBranchBiSlider(
				parallelCoordinates,
				E_PossibleBranches.COST,
				1,
				Color.BLACK, 
				new ParallelLadder(E_PossibleBranches.COST,
						true, 
						true,
						Color.BLACK, Color.BLACK
						)
				);
		cost.setRangeThickness(10);
		
		ParallelBranchSlider gazol = new ParallelBranchSlider(
				parallelCoordinates,
				E_PossibleBranches.GAZOL,
				2,
				Color.GREEN,
				new ParallelLadder(E_PossibleBranches.GAZOL,
						true, 
						true,
						Color.GREEN, Color.GREEN
						)
				);
		
		ParallelBranchSlider averageSpeed = new ParallelBranchSlider(
				parallelCoordinates,
				E_PossibleBranches.AVERAGE_SPEED,
				3,
				Color.BLACK,
				new ParallelLadder(E_PossibleBranches.AVERAGE_SPEED,
						true, 
						true,
						Color.BLACK, Color.BLACK
						)
				);
		
		ParallelBranchSlider lawViolation = new ParallelBranchSlider(
				parallelCoordinates,
				E_PossibleBranches.LAW_VIOLATION_PROBABILITY,
				4,
				Color.BLACK,
				new ParallelLadder(E_PossibleBranches.LAW_VIOLATION_PROBABILITY,
						true, 
						true,
						Color.BLACK, Color.BLACK
						)
				);
		
		ParallelBranchSlider numberOfStops = new ParallelBranchSlider(
				parallelCoordinates,
				E_PossibleBranches.NUMBER_OF_STOPS,
				5,
				Color.GREEN,
				new ParallelLadder(E_PossibleBranches.NUMBER_OF_STOPS,
						true, 
						true,
						Color.GREEN, Color.GREEN
						)
				);


		parallelCoordinates.getControler().addBranch(nbKm);
		parallelCoordinates.getControler().addBranch(gazol);
		parallelCoordinates.getControler().addBranch(averageSpeed);
		parallelCoordinates.getControler().addBranch(lawViolation);
		parallelCoordinates.getControler().addBranch(cost);
		parallelCoordinates.getControler().addBranch(numberOfStops);

		parallelCoordinates.getControler().orderBranchesByPosition();
		parallelCoordinates.getControler().createAllBranches();
		
		

		parallelCoordinates.revalidate();
		parallelCoordinates.repaint();
	}

}
